package com.sen.uaa;

import com.sen.common.feign.annotation.EnableSenFeignClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author esJiang
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableSenFeignClient
public class UaaApplication {

    public static void main(String[] args) {
        if(args.length!=0){
            System.setProperty("spring.profiles.active",args[0]);
        }
        SpringApplication.run(UaaApplication.class,args) ;
    }

    @Bean
    @LoadBalanced
    RestTemplate restTemplate(){
        return new RestTemplate() ;
    }
}
